﻿using System;
using System.Data;
using System.Collections;
using CE.Database;

/// <summary>
/// Summary description for LibertyProposalDB
/// </summary>
/// 
namespace CE.PersonalAccident
{
    public class LibertyProposalDB
    {
        public LibertyProposalDB()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public Int64 Insert(LibertyProposal libertyproposal)
        {
            MyDatabase _db = new MyDatabase();
            Int64 _result = -1;
            string _spName = "sprocPAProposalInsertUpdateSingleItemLiberty";

            SortedList _sPara = new SortedList();

            #region Parameter
            _sPara.Add("@PAProposalId", libertyproposal.PAProposalId);
            _sPara.Add("@PAId", libertyproposal.PAId);
            _sPara.Add("@PACompanyId", libertyproposal.PACompanyId);
            _sPara.Add("@PAInsId", libertyproposal.PAInsId);
            //_sPara.Add("@Salutation", libertyproposal.Salutation);
            _sPara.Add("@Name", libertyproposal.Name);
            _sPara.Add("@PostalCode", libertyproposal.PostalCode);
            _sPara.Add("@UnitNo", libertyproposal.UnitNo);
            _sPara.Add("@HomeNo", libertyproposal.HomeNo);
            _sPara.Add("@Address", libertyproposal.Address);
            _sPara.Add("@Gender", libertyproposal.Gender);
            _sPara.Add("@NRICNo", libertyproposal.NRICNo);
            _sPara.Add("@Nationality", libertyproposal.Nationality);
            _sPara.Add("@MobileNo", libertyproposal.MobileNo);
            _sPara.Add("@OfficePhoneNo", libertyproposal.OfficePhoneNo);
            _sPara.Add("@Email", libertyproposal.Email);
            //_sPara.Add("@NatureofBusiness", libertyproposal.NatureofBusiness);
            _sPara.Add("@CompanyROCNo", libertyproposal.CompanyROCNo);
            _sPara.Add("@SpouseName", libertyproposal.SpouseName);
            _sPara.Add("@SpouseGender", libertyproposal.SpouseGender);
            _sPara.Add("@SpouseNRICNo", libertyproposal.SpouseNRICNo);
            _sPara.Add("@SpouseNationality", libertyproposal.SpouseNationality);
            _sPara.Add("@SpouseRelation", libertyproposal.SpouseRelation);
            _sPara.Add("@HasOccupationFall", libertyproposal.HasOccupationFall);
            _sPara.Add("@OccupationFall", libertyproposal.OccupationFall);
            _sPara.Add("@HasEngagedSportsActivities", libertyproposal.HasEngagedSportsActivities);
            _sPara.Add("@EngagedSportsActivities", libertyproposal.EngagedSportsActivities);
            _sPara.Add("@HasPhysicalDefects", libertyproposal.HasPhysicalDefects);
            _sPara.Add("@PhysicalDefects", libertyproposal.PhysicalDefects);
            _sPara.Add("@HasOtherInsurance", libertyproposal.HasOtherInsurance);
            _sPara.Add("@OtherInsuranceCompany", libertyproposal.OtherInsuranceCompany);
            _sPara.Add("@OtherInsuranceDetails", libertyproposal.OtherInsuranceDetails);
            _sPara.Add("@HasAnyClaimsfromInsurer", libertyproposal.HasAnyClaimsfromInsurer);
            _sPara.Add("@AnyClaimsfromInsurer", libertyproposal.AnyClaimsfromInsurer);
            _sPara.Add("@HasInsuranceCancelled", libertyproposal.HasInsuranceCancelled);
            _sPara.Add("@InsuranceCancelledDetails", libertyproposal.InsuranceCancelledDetails);
            _sPara.Add("@PamentType", libertyproposal.PamentType);          
            _sPara.Add("@RefCEUserId", libertyproposal.RefCEUserId);
            _sPara.Add("@ViewedDetailId", libertyproposal.ViewedDetailId);
            _sPara.Add("@Status", libertyproposal.Status);
            #endregion

            _result = _db.ExecuteSP(_spName, _sPara);

            return _result;
        }

    }
}